Skip to main content

Explain object oriented analysis and design.

Object-Oriented Analysis and Design (OOAD)​

Object-Oriented Analysis and Design (OOAD) is a software engineering approach that models a system as a group of interacting objects. Each object represents some entity of interest in the system being modeled, and is characterized by its class, its state (data), and its behavior (operations).

Object-Oriented Analysis (OOA)​

Object-Oriented Analysis focuses on understanding the problem domain and requirements of the system. It identifies the objects, their attributes, and behaviors within the problem domain.

Key Activities in OOA:​

  1. Identifying Objects and Classes

    • Analyze the problem domain to identify real-world entities
    • Group similar objects into classes
    • Define the purpose and scope of each class
  2. Identifying Attributes

    • Determine the characteristics (data) that each object must store
    • Define the types and constraints for these attributes
  3. Identifying Operations

    • Define the behaviors (methods) that each object must perform
    • Specify how objects interact with each other
  4. Identifying Relationships

    • Establish associations between objects
    • Define inheritance hierarchies
    • Identify composition and aggregation relationships
  5. Creating Domain Models

    • Develop class diagrams representing the problem domain
    • Create use case diagrams to capture system functionality
    • Build sequence diagrams for dynamic behavior

Object-Oriented Design (OOD)​

Object-Oriented Design transforms the conceptual model created during analysis into a design model that serves as a blueprint for implementation. It focuses on how the system will be built.

Key Activities in OOD:​

  1. System Design

    • Define the overall architecture of the system
    • Organize classes into packages or subsystems
    • Establish communication mechanisms between subsystems
  2. Object Design

    • Refine class definitions with implementation details
    • Design interfaces and specific methods
    • Define data structures for attributes
    • Optimize class relationships for implementation
  3. Mechanism Design

    • Design how objects will interact during runtime
    • Define communication protocols between objects
    • Specify exception handling mechanisms
  4. User Interface Design

    • Design the user interface objects
    • Define how UI objects interact with domain objects
  5. Data Management Design

    • Design persistence mechanisms
    • Define database mappings for objects
    • Design data access strategies

Core Principles of OOAD​

1. Abstraction​

  • Focusing on essential qualities of an entity while ignoring the non-essential details
  • Defining objects that represent abstract concepts in the problem domain

2. Encapsulation​

  • Hiding the internal state and functionality of an object
  • Exposing only what is necessary through well-defined interfaces
  • Protecting data integrity and implementation details

3. Inheritance​

  • Creating new classes that reuse, extend, and modify the behavior defined in other classes
  • Building hierarchical classifications of objects
  • Promoting code reuse and establishing "is-a" relationships

4. Polymorphism​

  • Allowing objects of different classes to be treated as objects of a common superclass
  • Enabling the same interface to be used for different underlying forms
  • Supporting method overriding and dynamic binding

OOAD Process​

The OOAD process typically follows these steps:

  1. Requirements Gathering

    • Collect and analyze user requirements
    • Define system scope and constraints
  2. Analysis

    • Create conceptual models of the problem domain
    • Identify objects, relationships, and behaviors
    • Develop use cases to capture functionality
  3. System Design

    • Define the overall architecture
    • Organize classes into subsystems
    • Design communication mechanisms
  4. Object Design

    • Detail class specifications
    • Design algorithms for methods
    • Optimize object relationships
  5. Implementation

    • Code the classes and relationships
    • Implement methods and attributes
    • Build the user interface
  6. Testing

    • Verify object behavior against requirements
    • Test interactions between objects
    • Validate system functionality
  7. Maintenance

    • Extend the object model as requirements evolve
    • Refine implementations for improved performance
    • Fix defects while preserving object integrity

Benefits of OOAD​

  1. Natural Modeling: Maps closely to real-world entities and concepts
  2. Modularity: Encapsulated objects create natural modules in the system
  3. Reusability: Classes can be reused across applications
  4. Maintainability: Changes are localized to specific objects
  5. Scalability: New objects can be added with minimal impact
  6. Parallel Development: Team members can work on different classes simultaneously
  7. Quality: Promotes robust, well-structured designs

OOAD Notations and Tools​

  1. Unified Modeling Language (UML)

    • Class diagrams
    • Use case diagrams
    • Sequence diagrams
    • Activity diagrams
    • State diagrams
    • Component diagrams
    • Deployment diagrams
  2. CASE Tools

    • Visual modeling tools
    • Code generation capabilities
    • Reverse engineering features
    • Documentation generators

Real-World Example: Library Management System​

Object-Oriented Analysis:​

  1. Identify Classes:

    • Book, Member, Librarian, Catalog, Loan, Reservation
  2. Identify Attributes:

    • Book: ISBN, title, author, publisher, status
    • Member: ID, name, address, phone, email, loans
    • Loan: book, borrower, date borrowed, due date
  3. Identify Operations:

    • Book: checkOut(), return(), reserve()
    • Member: borrowBook(), returnBook(), payFine()
    • Librarian: addBook(), removeBook(), processReturn()
  4. Identify Relationships:

    • Member borrows Books (1-to-many)
    • Librarian manages Books (many-to-many)
    • Book has a Loan status (1-to-1)

Object-Oriented Design:​

  1. Class Design:

    public class Book {
    private String isbn;
    private String title;
    private String author;
    private BookStatus status;

    public void checkOut(Member member) {
    if (status == BookStatus.AVAILABLE) {
    // Create new loan
    // Update status
    }
    }

    public void returnBook() {
    // Update status
    // Process any waiting reservations
    }
    }

    public class Member {
    private String id;
    private String name;
    private List<Loan> currentLoans;

    public boolean borrowBook(Book book) {
    if (currentLoans.size() < LOAN_LIMIT) {
    // Process loan
    return true;
    }
    return false;
    }
    }
  2. System Design:

    • Authentication Subsystem
    • Catalog Management Subsystem
    • Loan Processing Subsystem
    • Reservation Subsystem
    • Member Management Subsystem
  3. User Interface Design:

    • Search interface
    • Member dashboard
    • Librarian administrative console

Object-Oriented Analysis and Design provides a comprehensive approach to understanding complex systems and translating that understanding into a structured, maintainable implementation. By focusing on objects that mirror real-world entities, OOAD creates systems that are more intuitive and adaptable to changing requirements.